<template>
  <view class="zone_container">

    <swiper autoplay :interval="3000" circular>
      <swiper-item v-for="(item, index) in imageList" :key="index">
        <ImageCache :src="item.image" @click="clickActivity(item)" class="img"></ImageCache>
      </swiper-item>
    </swiper>

  </view>
</template>

<script>
import { getCouponBanner } from '@/api/home/index'

export default {
  props: {
    data: {
      type: Object,
      default: () => { }
    }
  },
  data () {
    return {
      imageList: [],
    }
  },
  created () {
    this.getBanner()
  },
  methods: {
    getBanner () {
      this.imageList = this.data.children
    },
    clickActivity (item) {
      uni.navigateTo({
        url: `/subpackage/activity/activity?promotionType=${item.path}&title=${item.param.title}`
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.zone_container {
  width: 686rpx;
  margin: 0 7rpx;
  swiper {
    height: 226rpx;
  }
}
</style>
